using FrameworkDesign;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SlotGroup
{
    public Func<IItem, bool> Condition { get; private set; }
    public Func<List<Slot>, bool> GroupConditions { get; private set; }
    public List<Slot> Slots { get; } = new List<Slot>();
    //public IReadOnlyList<Slot> Slots=>mSlots;
    public SlotGroup(int count)
    {
        Condition += (i) => true;
        CreatSlotByCount(count);
    }
    public SlotGroup WriteCondition(Func<IItem, bool> condition)
    {
        
        Condition = null;
        Condition = condition;
        return this;
    }
    public void CreatSlotByCount(int count)
    {
        for (int i = 0; i < count; i++)
        {
            Slots.Add(new Slot(this));
        }
    }
    public void CreatSlotByItem(IItem item, int count)
    {
        Slots.Add(new Slot(item, count, this));
    }
}
